<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>欢迎登录</title>
    <link href="../css/admin/login.css" type="text/css" rel="stylesheet">
    <script src="../js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript">
        function  login(){
            $.post("../loginadmin/login",$("#loginForm").serialize(),function(res){
                if (res.code == 201 ||res.code == 500){
                    alert(res.msg);
                }else if (res.code == 200){
                    window.sessionStorage.setItem("account",res.data.account);
                    window.sessionStorage.setItem("id",res.data.id);
                    window.sessionStorage.setItem("type",res.data.type);
                    window.sessionStorage.setItem("newFileName",res.data.newFileName);
                    location.replace("success.html");
                }
            },"json");
        }
    </script>
</head>
<body>
<div class="login">
    <div class="title">欢迎登录</div>
    <div id="darkbannerwrap"></div>
    <form id="loginForm">

        <input name="account" placeholder="账号" type="text">
        <hr class="hr15">
        <input name="password" placeholder="密码" type="password">
        <hr class="hr15">
        <input value="登录" style="width:100%;" type="button" onclick="login()">

    </form>
</div>
</body>
</html>